package edu.ubb.scrumster.model.model;

public class Notification implements AbstractModel{
	int id;
	User sender;
	User receiver;
	String message;
	boolean seen;

	public Notification(User sender, User receiver, String message, boolean seen) {
		super();
		this.sender = sender;
		this.receiver = receiver;
		this.message = message;
		this.seen = seen;
	}

	public Notification(int id, User sender, User receiver, String message,
			boolean seen) {
		super();
		this.id = id;
		this.sender = sender;
		this.receiver = receiver;
		this.message = message;
		this.seen = seen;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public User getSender() {
		return sender;
	}

	public void setSender(User sender) {
		this.sender = sender;
	}

	public User getReceiver() {
		return receiver;
	}

	public void setReceiver(User receiver) {
		this.receiver = receiver;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public boolean getSeen() {
		return seen;
	}

	public void setSeen(boolean seen) {
		this.seen = seen;
	}
	
	public void validate() throws ModelException{
		if (this.receiver==null){
			throw new ModelException("There is no receiver.");
		}
		if (this.message.equals("") || this.message.isEmpty()){
			throw new ModelException("The message is empty");
		}
	}

}
